package com.hunliji.monitor.share.enums;

import java.util.Objects;
import java.util.stream.Stream;

/**
 * File：AtTypeEnum.java<br> Title: <br> Description: <br>
 *
 * @author lejin
 */
public enum AtTypeEnum {

    NONE("none", "不艾特人"),
    USER("user", "艾特特定用户"),
    ALL("all", "艾特所有人"),
    ACTION_STRATEGY("action_strategy","行动策略")
    ;

    private final String code;
    private final String msg;

    AtTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static AtTypeEnum getEnumByCode(String code) {
        return Stream.of(AtTypeEnum.values()).filter(o -> Objects.equals(o.getCode(), code)).findAny().orElse(null);
    }
}
